package ex_class;

public class Car {
	static int carNum = 0;
	public String name;
	protected String color;
	boolean gas;
	
	public Car() {
		incCarNum();
	}
	
	public Car(String name) {
		this.name = name;
		incCarNum();
	}
	
	public Car(String name, String color, boolean gas) {
		this.name = name;
		this.color = color;
		this.gas = gas;
		incCarNum();
	}
	
	private void incCarNum() {
		carNum++;
	}
	
	public void run() {
		if (gas) {
			System.out.println("부릉 부릉");
		} else {
			System.out.println("덜컹 덜컹");
		}
	}
	
	public void stop() {
		System.out.println("끼이익");
	}

}
